home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12229 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: lrz-muenchen.de!news
  2. From: watzka@stat.uni-muenchen.de (Kurt Watzka)
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: Re: Statistically Random Number algorithm
  5. Date: 18 Mar 1996 21:43:33 GMT
  6. Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
  7. Distribution: world
  8. Message-ID: <4ikle5$1rf@sparcserver.lrz-muenchen.de>
  9. References: <314D0B67.3C16@psu.edu>
  10. NNTP-Posting-Host: sun2.lrz-muenchen.de
  11.  
  12. "Jason A. Soloff" <jas251@psu.edu> writes:
  13.  
  14. >I am working on a monte carlo simulation program to model some problems 
  15. >in astronomy.  One thing I am running into, however, is the problem of 
  16. >the pseudo-random number tables.  Does anyone have an algorithm (or 
  17. >code) for a truly statistically random number generator?
  18.  
  19. A guy from NASA once suggested that it is really simple. All you need
  20. is a satelite that records the background radiation. You digitize 
  21. that and have a perfectly random sequence of random numbers.
  22.  
  23. For us mere mortals, the quote from John v. Neumann still holds:
  24.  
  25.    Anyone who considers arithmetical methods of producing
  26.    random digits is, of course, in a state of sin.
  27.  
  28. So, the answer for C (and C++) still is: Use rand(). If rand() is not
  29. good enough for you, maybe the random number generators available
  30. on your system will be a solution.
  31.  
  32. The word algorithm implies a _deterministic_ process, and there
  33. cannot be a deterministic process that produces _random_ output.
  34.  
  35. Kurt
  36. --
  37. | Kurt Watzka                             Phone : +49-89-2180-6254
  38. | watzka@stat.uni-muenchen.de
  39. | ua302aa@sunmail.lrz-muenchen.de
  40.  
  41.